<?php 
$zebra=0;
if ($data->num_rows() > 0):
	foreach($data->result_array() as $ch):
?>
	<tr <?php if ($zebra++%2==1):?> class="zebra" <?php endif?> 
		onmouseover="$(this).getElements('select[class:selectButton]').setStyle('visibility','visible')"
		onmouseout="$(this).getElements('select[class:selectButton]').setStyle('visibility','hidden')">
	<td><?php echo $ch['perb_tgl_lapor']?></td>
	<td><?php echo $ch['perb_tgl_kejadian']?></td>
	<td><?php echo $ch['perb_tempat_kejadian']?></td>
	<td><?php echo $ch['perb_keterangan']?></td>
	<td><?php 
		switch($ch['perb_status']){
		default:
			echo $status_options[$ch['perb_status']];
		}
	?></td>
	<td align="right" width="10%">
		<!--<?php if ($ch['perb_poster'] == md5($usrname)):?>
		<input class="buttonSmall" type="button" style="font-size: 14px; visibility:hidden;" value="!" 
			onclick="document.location='<?php echo site_url(array('psdm','perbuatan','edit',$ch['perb_id'])) ?>'" />
		<?php endif;?>
		<input class="buttonSmall" type="button" style="font-size: 14px; visibility:hidden;" value="-" 
			onclick="FBModal_confirm(APP.base+'/ajax/confirmDialog', 'Delete', 'Hapus record ?', 
				'do_delete($(this), \'<?php echo $ch['perb_id']?>\')')" />-->
		<select class="selectButton" style="visibility: hidden;" onchange="eval(this.value); this.selectedIndex=0">
			<option>--- pilih ---</option>
			<?php if ($ch['perb_status']=='DR'):?>
			<option value="doUpdateStatus('<?php echo $ch['perb_id']?>','RA')">Post</option>
			<?php endif;?>
			<?php if ($ch['perb_poster'] == md5($usrname) && $ch['perb_status']=='DR'):?>
			<option value="document.location='<?php echo site_url(array('psdm','perbuatan','edit',$ch['perb_id'])) ?>'">Edit</option>
			<?php endif?>
			<option value="FBModal_confirm(APP.base+'/ajax/confirmDialog', 'Delete', 'Hapus record ?', 
				'do_delete($(this), \'<?php echo $ch['perb_id']?>\')')">Delete</option>
		</select>
	</td>
	</tr>
<?php 
	endforeach;
else:
?><tr><td align="center" colspan="6">Tidak ada data</td></tr><?php 
endif;